<template>
  <HPopup title="关联数据" v-model:show="innerShow">
    test: {{ relationData }}
  </HPopup>
</template>
<script setup>
import HPopup from '@comp/HPopup/HPopup.vue';
import {computed, nextTick, watch} from 'vue';
import {createProps} from '@/utils';

defineOptions({name: 'RelationFormModelPop'});
const props = defineProps({
  show: createProps(Boolean, false),
  relationData: createProps(Object),
});
const emits = defineEmits(['update:show']);
const innerShow = computed({
  get() {
    return props.show;
  },
  set(show) {
    emits('update:show', show);
  }
});

function loadData() {
  console.log('loadData');
}

watch(() => [props.show], () => {
  nextTick(() => {
    if (props.show) {
      loadData()
    }
  })
}, {
  immediate: true,
});
</script>
<style scoped lang="less">

</style>